using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Facebook;
using Facebook.Components;
using System.Collections.ObjectModel;

namespace Profile
{
    public partial class ProfileDlg : Form
    {
        public string m_sn;
        private CBuddyIdAssociation m_bdId;
        private FacebookService facebookService1;
        public ProfileDlg(FacebookService sr, CBuddyIdAssociation assoc)
        {
            InitializeComponent();
            facebookService1 = sr;
            m_bdId = assoc;
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            string id = m_bdId[m_sn];   //screen name that is set prior
            Facebook.User fb = facebookService1.GetUserInfo(id)[0];
            facebookPic.Image = fb.Picture;
            facebookAwayTxtBx.Text = fb.AboutMe;
            Facebook.Service.FacebookService sr2 = new 
                Facebook.Service.FacebookService("6f542812b4a26376877e79db0ce7f4d9","43aa4ec7ac3b3795db43734556ee794c",
                facebookService1.SessionKey,facebookService1.UserId);
            
            //Collection<Facebook.Service.User> uCol = sr2.Friends.GetFriends();
            //foreach(Facebook.Service.User u in uCol)
            //{
            //    if (u.ID == fb.UserId)
            //    {
            //        facebookAwayTxtBx.Text = u.Status.Message;
            //        return;
            //    }
            //}
            //Facebook.Service.User u = (Facebook.Service.User)
            object d = sr2.Fql.ExecuteQuery("SELECT * FROM user WHERE uid=" + fb.UserId);
            //facebookAwayTxtBx.Text = fb.UserId
        }
    }
}